package com.essc.dto;

import com.essc.pojo.Goods;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class OrderDto {
    private Integer oid;
    private String send;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date time;
    private Goods goods;
    private SellerDto sellerDto;
    private BuyerDto buyerDto;

    //topay方法接收前端的数据
    public OrderDto(Integer oid, String send, Date time, Goods goods, SellerDto sellerDto, BuyerDto buyerDto) {
        this.oid = oid;
        this.send = send;
        this.time = time;
        this.goods = goods;
        this.sellerDto = sellerDto;
        this.buyerDto = buyerDto;
    }

    public OrderDto() {
    }

    //tobuy之后返回给前端的数据
    public OrderDto(Integer oid, Goods goods, SellerDto sellerDto, BuyerDto buyerDto) {
        this.oid = oid;
        this.goods = goods;
        this.sellerDto = sellerDto;
        this.buyerDto = buyerDto;
    }



    public Integer getOid() {
        return oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public String getSend() {
        return send;
    }

    public void setSend(String send) {
        this.send = send;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public SellerDto getSellerDto() {
        return sellerDto;
    }

    public void setSellerDto(SellerDto sellerDto) {
        this.sellerDto = sellerDto;
    }

    public BuyerDto getBuyerDto() {
        return buyerDto;
    }

    public void setBuyerDto(BuyerDto buyerDto) {
        this.buyerDto = buyerDto;
    }

    @Override
    public String toString() {
        return "OrderDto{" +
                "oid=" + oid +
                ", send='" + send + '\'' +
                ", time='" + time + '\'' +
                ", goods=" + goods +
                ", sellerDto=" + sellerDto +
                ", buyerDto=" + buyerDto +
                '}';
    }
}
